package com.cmnit.tools.kafka


import com.cmnit.tools.utils.KafkaUtils
import org.apache.log4j.Logger


object KafkaTools {
  val logger: Logger = Logger.getLogger(KafkaTools.getClass)

  def getOffset(topic: String, isStart: String): Unit = {
    // offset查询
    if ("true".equals(isStart)) {
      logger.info("获取指定topic的最初offset")
      KafkaUtils.getPartitionsForTopic(topic, true)
    } else {
      logger.info("获取指定topic的最新offset")
      KafkaUtils.getPartitionsForTopic(topic, false)
    }

  }
}
